package com.lyz.dataStructure.JianZhiOffer.array;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 20:09
 * @Description:
 **/

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/7/23 20:09
 *@Description:
 **/
public class Test31 {
    public static void main(String[] args) {
        int[] nums = {2,3,4,1};
        System.out.println(minNumber(nums));
    }

    public static int minNumber(int[] nums){
        if(nums.length==0) return 0;
        int l =0,h =nums.length-1;
        while (l<h){
            int m = l+(h-1)/2;
            if(nums[m]<=nums[h])
                h =m ;
            else
                l =m+1;

        }
        return nums[l];
    }
}
